package com.cqc.jdk8.Jutil.concurrent.locks.ReentrantLock.demo1;


public class Counter {
    private int count = 0;

    public void add() {
        synchronized (this) {
            count++;
            System.out.println(Thread.currentThread().getName() + ":" + count);
        }
    }

    public int getCount() {
        return count;
    }
}
